// export var sharedMenuCollapse = {
//   debug: true,
//   state: {
//     value: false,
//   },
//   setMessageAction(newValue) {
//     if (this.debug) console.log("setMessageAction triggered with", newValue);
//     this.state.value = newValue;
//   },
//   clearMessageAction() {
//     if (this.debug) console.log("clearMessageAction triggered");
//     this.state.value = "";
//   },
// };
class baseStore {
  constructor() {}
  init = () => {
    this.setState(this.state ? this.state : {});
    return this;
  };
  setState = (value) => {
    this.state = new Proxy(value, {
      get: function (target, prop, receiver) {
        return target[prop];
      },
      set: function (target, prop, receiver) {
        console.log("不允许");
      },
    });
  };
}
class sharedMenuCollapse extends baseStore {
  constructor() {
    super();
  }
}

export const sharedMenuCollapsex = new sharedMenuCollapse().init();

export function setMenuCollapse(data) {
  sharedMenuCollapsex.setState(data);
}
